#include "Shader.h"

vertex_shader_output GVertexShader::CalcOutput(vertex_shader_payload payload)
{
	vertex_shader_output out_put;
	out_put.position = payload.position;
	out_put.position = out_put.position / out_put.position.w();

	out_put.sv_position = payload.camera->GetMVPMatrix() * payload.position;
	out_put.texcoord0 = payload.texcoord0;

	return out_put;
}

int GFragmentShader::CalcOutput(fragment_shader_payload payload)
{
	int nx = int(payload.uv[0] * payload.main_tex->GetWidth());
	int ny = int(payload.uv[1] * payload.main_tex->GetHeight());
	return payload.main_tex->GetPixel(nx, ny);
}